<script setup>
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router'
// import { getdata } from "../../API/api"
const active = ref(0);
// const az=ref(["*","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T",'U',"V","W","X","Y","Z"])
const router = useRouter()
const xinxi = (item) => {
  router.push({
        path:"/fas",
        query:item
  })
}
const data = ref({
  datas: [
    {
      id: 110,
      name: '徐帅',
      img: "https://img1.baidu.com/it/u=193696007,2125345610&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=a7a4494fa9f83a5b8e97ea56679789ef"
    },
    {
      id: 111,
      name: '李四',
      img: "https://img1.baidu.com/it/u=193696007,2125345610&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=a7a4494fa9f83a5b8e97ea56679789ef"
    },
    {
      id: 112,
      name: '王五',
      img: "https://img1.baidu.com/it/u=187585967,3882185192&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=6ab34d26ee4d96932396758b6352f7e5"
    },
    {
      id: 113,
      name: '赵六',
      img: "https://img1.baidu.com/it/u=187585967,3882185192&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=6ab34d26ee4d96932396758b6352f7e5"
    }
  ]
})
// const getda = async () => {
//   const res = await getdata()
//   // data.value = res.data
//   console.log(res)
// }
// onMounted(() => {
//   getda()
// })
</script>
<template>

  <van-nav-bar title="通讯录">
    <template #right>
      <van-icon name="search" size="22" />
      <van-icon name="add-o" size="22" />
    </template>
  </van-nav-bar>
  <van-index-bar>



    <van-index-anchor />
    <div @click="xinxi(item)" v-for="item in data.datas">
      <img
        :src="item.img"
        alt="">
      <van-cell :title="item.name" />
    </div>
    <!-- <div>
      <img
        src="https://img1.baidu.com/it/u=193696007,2125345610&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=a7a4494fa9f83a5b8e97ea56679789ef"
        alt="">
      <van-cell title="李四" />
    </div> -->
    <!-- <img
      src="https://img1.baidu.com/it/u=187585967,3882185192&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1724173200&t=6ab34d26ee4d96932396758b6352f7e5"
      alt="">
    <van-cell title="王五" /> -->

  </van-index-bar>


</template>
<style scoped>
i {
  padding: 5px;
}

img {
  width: 30px;
  height: 30px;
  float: left;
}

.van-cell {

  width: 80%;
}
</style>
